home *** CD-ROM | disk | FTP | other *** search
/ Champak 122 / Vol 122.iso / games / need_for.swf / scripts / %3Cdefault package%3E / FSimpleButton.as
Encoding:
Text File  |  2011-01-06  |  1.6 KB  |  63 lines

  1. FSimpleButton = function()
  2. {
  3.    this.init();
  4. };
  5. FSimpleButton.prototype = new MovieClip();
  6. FSimpleButton.prototype.init = function()
  7. {
  8.    this.caption_txt.text = this.captionText;
  9.    this.caption_txt.textColor = this.captionColor;
  10.    this.useHandCursor = this.showHand;
  11.    this.tabEnabled = false;
  12.    this.onRollOut = this.myRollOut;
  13.    this.onRollOver = this.myRollOver;
  14.    this.onPress = this.myPress;
  15.    this.onRelease = this.myRelease;
  16.    this.onDragOut = this.myDragOut;
  17.    this.onDragOver = this.myDragOver;
  18.    this.onReleaseOutside = this.myReleaseOutside;
  19. };
  20. FSimpleButton.prototype.myRollOut = function()
  21. {
  22.    this._parent[this.statusVar] = _global.oldStatusText;
  23. };
  24. FSimpleButton.prototype.myRollOver = function()
  25. {
  26.    _global.oldStatusText = this._parent[this.statusVar];
  27.    this._parent[this.statusVar] = this.statusText;
  28. };
  29. FSimpleButton.prototype.myPress = function()
  30. {
  31. };
  32. FSimpleButton.prototype.myRelease = function()
  33. {
  34.    this._parent[this.clickHandler](this);
  35. };
  36. FSimpleButton.prototype.myDragOut = function()
  37. {
  38.    this.gotoAndStop("_up");
  39. };
  40. FSimpleButton.prototype.myDragOver = function()
  41. {
  42. };
  43. FSimpleButton.prototype.myReleaseOutside = function()
  44. {
  45. };
  46. FSimpleButton.prototype.disable = function()
  47. {
  48.    this.caption_txt.textColor = this.captionDisabledColor;
  49.    this.gotoAndStop("disabled");
  50.    this.enabled = false;
  51. };
  52. FSimpleButton.prototype.enable = function()
  53. {
  54.    this.enabled = true;
  55.    this.gotoAndStop("_up");
  56.    this.caption_txt.textColor = this.captionColor;
  57. };
  58. FSimpleButton.prototype.isEnabled = function()
  59. {
  60.    return this.enabled;
  61. };
  62. Object.registerClass("FSimpleButton",FSimpleButton);
  63.